package org.xu.controller;

import com.core.base.Reply;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.xu.dto.MenuDTO;
import org.xu.utils.MenuMockDataUtil;

import java.util.*;

@RequestMapping("/menu/")
@RestController
public class MenuController {

    @ResponseBody
    @RequestMapping("/current/user/get")
    public Reply<List<MenuDTO> > getMenus(){
        List<MenuDTO> dto = getMenuDTO();
        return Reply.success(dto);
    }

    public static List<MenuDTO> getMenuDTO(){
        List<MenuDTO> list = MenuMockDataUtil.listSystemMenu();
        List<MenuDTO> approvalMenu = MenuMockDataUtil.listApprovalMenu();
        list.addAll(approvalMenu);
        return list;
    }

}
